import QtQuick
import QtQuick.Controls

Item {
    width: parent.width
    height: parent.height

    Button {
        x: 50
        y: 50
        text: "Show Modal Popup"
        onClicked: modalPopup.open()
    }

    Button {
        x: 300
        y: 300
        text: "Test Click"
    }

    Popup {
        id: modalPopup
        x: 50
        y: 90
        width: 300
        height: 200
        modal: true
        focus: true
        closePolicy: Popup.CloseOnEscape

        Column {
            anchors.centerIn: parent
            spacing: 10

            Label {
                text: "This is a Modal Popup"
                font.pixelSize: 16
            }

            Button {
                text: "Close"
                onClicked: modalPopup.close()
            }
        }
    }
}
